home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act6b / 00045.ls < prev    next >
Encoding:
Text File  |  1995-03-28  |  2.3 KB  |  68 lines

  1. on enterFrame
  2.   global partlist, abug, bbug, piecelist, listparts, TRIAL
  3.   set TRIAL to 0
  4.   repeat with xxx = 4 to 33
  5.     puppetSprite(xxx, 1)
  6.   end repeat
  7.   repeat with xxx = 41 to 46
  8.     puppetSprite(xxx, 1)
  9.   end repeat
  10.   set bugnumber to 4
  11.   set partlist to [:]
  12.   addProp(partlist, random(4), 1)
  13.   addProp(partlist, random(4), 1)
  14.   addProp(partlist, random(4), 1)
  15.   set stole to random(3)
  16.   addProp(partlist, 1, stole)
  17.   addProp(partlist, 1, 4 - stole)
  18.   addProp(partlist, 1, random(4))
  19.   set bbug to random(4)
  20.   repeat with abug = 1 to 4
  21.     if abug <> bbug then
  22.       set abugchan to 9 + ((abug - 1) * 6)
  23.       repeat with thispiece = 1 to 6
  24.         set binky to [:]
  25.         addProp(binky, random(4), 1)
  26.         addProp(binky, random(4), 1)
  27.         addProp(binky, random(4), 1)
  28.         set stole to random(3)
  29.         addProp(binky, 1, stole)
  30.         addProp(binky, 1, 4 - stole)
  31.         addProp(binky, 1, random(4))
  32.         repeat while binky = partlist
  33.           set binky to [:]
  34.           addProp(binky, random(4), 1)
  35.           addProp(binky, random(4), 1)
  36.           addProp(binky, random(4), 1)
  37.           set stole to random(3)
  38.           addProp(binky, 1, stole)
  39.           addProp(binky, 1, 4 - stole)
  40.           addProp(binky, 1, random(4))
  41.         end repeat
  42.         set sigil to getAt(getAt(piecelist, bugnumber), thispiece)
  43.         set apiece to getAt(getAt(sigil, getPropAt(binky, thispiece)), getAt(binky, thispiece))
  44.         if apiece > 0 then
  45.           set the castNum of sprite (abugchan + thispiece) to apiece
  46.         end if
  47.       end repeat
  48.     end if
  49.   end repeat
  50.   set abug to bbug
  51.   set abugchan to 9 + ((abug - 1) * 6)
  52.   repeat with thispiece = 1 to 6
  53.     set sigil to getAt(getAt(piecelist, bugnumber), thispiece)
  54.     set apiece to getAt(getAt(sigil, getPropAt(partlist, thispiece)), getAt(partlist, thispiece))
  55.     if apiece > 0 then
  56.       set the castNum of sprite (abugchan + thispiece) to apiece
  57.       set apart to "part" & bugnumber & "." & thispiece & "." & getPropAt(partlist, thispiece)
  58.       set apart to getAt(getAt(getAt(listparts, bugnumber), thispiece), getPropAt(partlist, thispiece))
  59.       set the castNum of sprite (3 + thispiece) to apart
  60.     end if
  61.     set the castNum of sprite (40 + thispiece) to 1 + getAt(castnumber, getAt(partlist, thispiece))
  62.   end repeat
  63.   repeat with xxx = 1 to 33
  64.     set the visible of sprite xxx to 1
  65.   end repeat
  66.   updateStage()
  67. end
  68.